package com.xiaoma.vm;


import java.util.*;

import static java.util.stream.Collectors.toList;

/**
 * https://pangpython.blog.csdn.net/article/details/88214405?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link
 */
public class Test {
/*    public static void main(String[] args) {

        VMInfo vmInfo = VMInfo.getVmInfo();
        System.out.println(vmInfo.totalString());
        System.out.println(vmInfo.toString());
    }*/



    private static Set<Long> beMixed1(Set<Long>... sets) {
        List<Set<Long>> collect = Arrays.stream(sets)
                .filter(Objects::nonNull)
                .collect(toList());
        Set<Long> longs = collect.get(0);
        collect.forEach(longs::retainAll);
        return longs;
    }
    public static void main(String[] args) {
        Set<Long> set=new HashSet<>();
        set=null;
        Set<Long> set1=new HashSet<>();
        set1.add(2342342342L);
        Set<Long> set2=new HashSet<>();
        set2.add(2342342342L);
        Set<Long> collect = beMixed1(set, set1,set2);
        System.out.println(collect);
    }
}
